# include "iostream"
using namespace std;

typedef struct listNode
{
    int val;
    listNode* next;
} listNode;

int main(){
    listNode* head = new listNode;
    head->val = 0;
    head->next = NULL;
    listNode* temp = head;
    for(int i = 1; i < 5; i++){
        listNode* newNode = new listNode;
        newNode->val = i;
        newNode->next = nullptr;
        temp->next = newNode;
        temp = newNode;
    }

    listNode* temp1 = head;
    while(temp1!= NULL){
        cout << temp1->val << " ";
        temp1 = temp1->next;
    }

    delete head;

       
    return 0;
}
